package io.rocketman.transport.channel;

import io.rocketman.config.client.ClientMetaData;
import io.rocketman.config.server.ServerMetaData;
import io.rocketman.transport.NetworkTransportException;

import java.net.InetSocketAddress;
import java.util.concurrent.Future;

/**
 * @author He Peng
 * @create 2018-05-25 0:17
 * @update 2018-05-25 0:17
 * @updatedesc : 更新说明
 * @see
 */
public interface Channel {

    void close();

    boolean isClose();

    boolean isOpen();

    InetSocketAddress getRemoteAddress();

    InetSocketAddress getLocalAddress();

    ServerMetaData getServerMetaData();

    ClientMetaData getClientMetaData();

    Future<?> send(Object message) throws NetworkTransportException;
}
